Explicitly specifying a void
parameter list is required in C, but optional in C++. Using void
for a parameter-less
function decreases its readability. The at-a-glance impression is that the function does take a parameter, and it takes a second look to
ascertain that it does not. Therefore the more compact notation is preferred.
Noncompliant code example
int fun(void);
int fun(void) {
...
}
Compliant solution
int fun();
int fun() {
...
}